#pragma once
#include "stdafx.h"
#include "vec3.h"
#include "Node.h"

class Bounds : public Node
{
};

// forward decleration
class BBox;

class BSphere : public Bounds
{
public:
	BSphere(void);
	BSphere(float radius);
	~BSphere(void);
	void SetRadius(float radius);
	float GetRadius(void);

	// Collision Checks
	bool bContainsBox(const BBox target);
	bool bIntersectsBox(const BBox target);
	bool bContainsSphere(const BSphere target);
	bool bIntersectsSphere(const BSphere target);
	bool bContainsPoint(const vec3 target);

	// Constrain Bounding object
//	void ContainBox(BBox * target);
//	void ContainSphere(BSphere * target);
//	void ContainPoint(vec3 * target);

	float radius;
};

class BBox : public Bounds
{
public:
	BBox(void);
	BBox(vec3 max, vec3 min);
	~BBox(void);
	void SetCorners(vec3 max, vec3 min);
	vec3 GetTopLeft(void);
	vec3 GetBotRight(void);

	// Collision Checks
	bool bContainsBox(const BBox target);
	bool bIntersectsBox(const BBox target);
	bool bContainsSphere(const BSphere target);
	bool bIntersectsSphere(const BSphere target);
	bool bContainsPoint(const vec3 target);

	// Constrain Bounding object
	void ContainBox(BBox * target);
	void ContainSphere(BSphere * target);
	void ContainPoint(vec3 * target);

	// Maximum and Minimum coordinates of the box
	vec3 max, min;
};